package form.ui.core {
	import flash.display.DisplayObject;
	import flash.display.Sprite;

	public class Frame extends FMSprite {
		private var frame:FMSprite = new FMSprite();
		
		public function Frame() {
			super();
			
			this.mouseEnabled = false;
			
			this.addChild(this.frame);
			this.mask = this.frame;
		}
		
		public override function set width(value:Number):void {
			super.width = value;
			this.frame.width = this.width; 
		}
		
		public override function set height(value:Number):void {
			super.height = value;
			this.frame.height = this.height;
		}
		
		public override function set dimensions(array:Array):void {
			super.dimensions = array;
			this.frame.dimensions = [this.width, this.height];
		}
		
		public override function removeChild(child:DisplayObject):DisplayObject {
			if (child == this.frame) { return null; }
			
			return super.removeChild(child);
		}
		
		public override function removeChildAt(index:int):DisplayObject {
			return this.removeChild(this.getChildAt(index));
		}
	}
}